local juyuan = fk.CreateSkill{
  name = "hanqing__juyuan",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["hanqing__juyuan"] = "拘渊",
  [":hanqing__juyuan"] = "锁定技，当你获得牌后，当前回合角色本回合使用【杀】的次数上限+1，手牌上限-1。",
}

juyuan:addEffect(fk.AfterCardsMove, {
  anim_type = "negative",
  can_trigger = function (self, event, target, player, data)
    if player:hasSkill(juyuan.name) then
      local turn_event = player.room.logic:getCurrentEvent():findParent(GameEvent.Turn, true)
      if turn_event == nil or turn_event.data.who.dead then return end
      for _, move in ipairs(data) do
        if move.to == player and move.toArea == Card.PlayerHand then
          event:setCostData(self, {tos = {turn_event.data.who}})
          return true
        end
      end
    end
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local to = event:getCostData(self).tos[1]
    room:addPlayerMark(to, MarkEnum.SlashResidue.."-turn", 1)
    room:addPlayerMark(to, MarkEnum.MinusMaxCards.."-turn", 1)
  end,
})

return juyuan
